from random import randint

def hunt_choices(round_number, current_food, current_reputation, m, player_reputations):
    # I am not using 'm' because my final goal is to have the most food, not for the tribe to have as much food as possible
    # 'm' becames important for me when I am on low supply of food, but then I only slack off, so there is still no point in considering it
    
    average = 0.0 # Average reputation of all players, not counting me
    number = -1 # Number of players, not counting me (array is indexed form 0)
    for reputation in player_reputations:
        average = average + reputation
        number = number + 1
    if number > 0: # I don't want my program to crash when only 2 of us are left :)
        average = average / number
    sorted_reputations = sorted(player_reputations) # Sorted list of reputations
    
    hunt_decisions = list()
    for reputation in player_reputations:
        if current_food < number*17: # If my food supply is running low, I have to start slacking (sick people don't go hunting XD)
            decision = 's'
        elif reputation < sorted_reputations[int(round(number*0.17))]: # I will not hunt with people who are slacking the most
            decision = 's'
        elif average > 0.5: # If average is greater than 50% that means that expectation for overall food should increase
            if current_reputation < sorted_reputations[int(round(number*(1 - average*0.83)))]: # In that case I try to keep my reputation as low as possible while at least half of other people still hunt with me(this is under the assumption that people hunt with the ones who have highest reputation)
                decision = 'h'
            else: # While my reputation is greater than what I target it to be I will still hunt sometimes because I don't want to have to hunt with slackers too often
                percentage = randint(0, 100)
                decision = 's'
                if current_reputation < reputation:
                    if reputation*reputation*reputation/8 > percentage/100.0: # I went for (reputation/2)^3 because I still don't want my reputation to be much higher than what I target it to be
                        decision = 'h'
        else: # If average is lower than 50% that means that expectation for overall food should decrease, meaning that if it stays that way in finite amount of time all (but one) will die
            if current_reputation < reputation: # So then I will want to try and kill of slackers, while keeping hunters, hoping for average to go over 50%
                decision = 'h'
            else:
                decision = 's'
        
        if round_number < 17: # First couple of rounds I can't get much information from facts, so I will mostly hunt
            precentage = randint(0, 100)
            if precentage > 17:
                decision = 'h'
            else:
                decision = 's'        
        
        if number < 17: # If there are only a couple of people left in the tribe, it is time to stop hunting because my reputation is not changing much anymore and game is going to end soon...
            if round_number > 1000:
                decision = 's'
        
        hunt_decisions.append(decision)     
    return hunt_decisions

def hunt_outcomes(food_earnings):
    # food_earnings can be very useful to figure out who is hunting with me and then trying to make my reputation such that more people would hunt with me
    # But to be completely honest I expect lots of fairly random programs, so I decided that it was not worth doing
    pass # do nothing

def round_end(award, m, number_hunters):
    # I don't particularly care about this information, given that I never chase team award
    pass # do nothing